package com.communal.dao;

import java.util.List;

import com.communal.model.Model;
import com.communal.model.cr.CRWater;
import com.communal.model.tarif.Tarif;
import com.communal.model.tarif.TarifWaterCold;
import com.communal.model.tarif.TarifWaterHot;
import com.communal.util.CommunalFilterBean;

/**
 * @author Created by andrey.kuznetsov <br>
 * @author Last modified by $Author$ <br>
 * @author Last modified on $Date$ at revision $Revision$ <br>
 */
public interface ICommunalDao extends IBaseDao{

	/**
	 * Returns all enabled communal records for current model sorted by year and month <br>
	 * @param p_model - model; {@link Model} <br>
	 * @param p_class - class of communal record; {@link Class} <br>
	 * @param p_filter - filter bean; {@link CommunalFilterBean} <br>
	 * @return list with communal records {@link List}<{@link T}>
	 */
	@SuppressWarnings("rawtypes")
	public <T> List<T> getRecords(Model p_model, Class p_class, CommunalFilterBean p_filter);
	
	/**
	 * Returns all enabled communal records for given model and tarif <br>
	 * @param <T>
	 * @param p_model - model; {@link Model} <br>
	 * @param p_class - class of communal record; {@link Class} <br>
	 * @param p_tarif - tarif (can be null); {@link T}<br>
	 * @return list with communal records {@link List}<{@link T}>
	 */
	@SuppressWarnings("rawtypes")
	public <T> List<T> getRecordsByTarif(Model p_model, Class p_class, Object p_tarif);
	
	/**
	 * Retunrs all enabled water records for given model and tarifs
	 * @param p_model - model; {@link Model} <br>
	 * @param p_tarifWaterCold - tarif for cold water (can be null); {@link TarifWaterCold}<br>
	 * @param p_tarifWaterHot tarif for hot water (can be null); {@link TarifWaterHot}<br>
	 * @return list with communal records {@link List}<{@link CRWater}>
	 */
	public List<CRWater> getWaterRecordsByTarif(Model p_model, TarifWaterCold p_tarifWaterCold, TarifWaterHot p_tarifWaterHot);
	
	/**
	 * Returns list of enabled tarifs for current model by name <br>
	 * @param p_model - model; {@link Model} <br>
	 * @param p_class - class of tarif; {@link Class} <br>
	 * @param p_name - name of tariff; {@link String} <br>
	 * @return founded tarif list or null
	 */
	@SuppressWarnings("rawtypes")
	public List<Tarif> getEnabledTarifsByName(Model p_model, Class p_class, String p_name);
}
